1. Field of the Invention
The present invention relates to a flaw detection apparatus for detecting flaws in mechanical components and other items and, more particularly, to a flaw detection apparatus utilizing the image processing techniques.
2. Description of the Prior Art
For the detection of flaws on an object, various kinds of flaw detection apparatuses utilizing the image processing technique are proposed. In FIG. 7A, a cylinder 1 having flaws on the surface thereof is shown. In FIG. 7B, a binary image of the surface area of the cylinder 1 in FIG. 7A, where plural flaws are available, is shown on an enlarged scale. When there is a flaw on a smooth surface, the area of the flaw will reflect irregularly. As a result, dark-field illumination, whereby light is emitted to the surface at an angle such that direct reflections do not enter the imaging apparatus, can be used in flaw detection by image processing because only reflections from the irregularly reflecting flaw area will enter the imaging apparatus, and an image of the flaw can thus be obtained. Thus, the binary image representing, for example five in this case, areas R1, R2, R3, R4, and R5 each corresponding to flaws separated to each other is obtained in a such manner, as shown in FIG. 7B.
To obtain this binary image, the input from the television camera is stored to an image storing circuit using an image input device. The stored image is then digitized. This means that pixels with a pixel density exceeding a predetermined threshold value are assigned a value of 1, and pixels with a pixel density below this threshold value are assigned a value of 0. As a result, when the image in FIG. 7A is digitized, the pixels in the area of the reflecting flaw are given a value of 1, and all other pixels are given a value of 0.
The next step is labelling. In labelling, the image is divided into areas of pixels each with a density value of 1 and areas of pixels each with a density value of 0. Linked areas are further formed in the density 1 pixel areas from vertically, horizontally, and diagonally adjacent pixels each with a density of 1, these linked areas are sequentially numbered throughout the image, and each pixel in linked areas is assigned the sequential number of the linked area to which it belongs.
After all pixels are labelled, the plural label numbers assigned to pixels in connected areas are unified to a single common label number in order to unify the pixel label numbers in connected label areas.
After this labelling process is completed, the area, or more specifically the number of pixels, of each uniquely numbered linked area (hereafter "label areas") is computed. While there may be reflections (density 1 pixel areas) other than flaws caused by irregular reflections from dust or other foreign matter or slight irregular reflection from smooth areas, these areas will be limited to a very small area. As a result, label areas smaller than a predetermined area threshold are eliminated to prevent false recognition of flaws, and the label areas exceeding a predetermined area threshold are extracted as "flaws".
The problem with this conventional method is described below. Specifically, flaws caused by an impact to the smooth surface area of the inspected item typically occur as a series of plural binary images as shown in FIG. 7A. When the flaw is a fine line of multiple imperfections and the label area of each individual imperfection is evaluated, the small area of each individual flaw makes it difficult to determine whether there is actually a flaw or simply dust or other foreign matter on the surface.